<?php
require_once '../config.php';
require_once '../dao/dao_db.php';
require_once '../dao/dao_profile.php';
$newpass	=trim($_POST['newpass']);
$passconfirm=trim($_POST['passconfirm']);
session_start();
if($_SESSION['userid']!=''){
	if($newpass!=''&&$passconfirm!=''&&$newpass===$passconfirm)
	{
		save_profile_pass($_SESSION['userid'],$newpass);
		mysql_close();
		header("LOCATION:../profile.php?msgcode=1");
	}else{
		header("LOCATION:../profile.php?msgcode=2");
	}
}
?>